ostree.git
11 years agoAdd OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER
Matthew Barnes [Sun, 22 Feb 2015 21:06:39 +0000 (16:06 -0500)]
Add OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER

Indicates the command requires superuser privilege.  Fails early with
a more helpful message than would otherwise be returned by libostree.

Currently all admin commands except 'status' require superuser.

11 years agoAdd OstreeAdminBuiltinFlags for admin commands
Matthew Barnes [Sun, 22 Feb 2015 20:41:02 +0000 (15:41 -0500)]
Add OstreeAdminBuiltinFlags for admin commands

Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.

11 years agotests: Add a test case for unwritable repos
Matthew Barnes [Wed, 4 Feb 2015 02:44:38 +0000 (21:44 -0500)]
tests: Add a test case for unwritable repos

11 years agoCheck repo permission prior to attempting to modify it
Matthew Barnes [Fri, 16 Jan 2015 18:28:36 +0000 (13:28 -0500)]
Check repo permission prior to attempting to modify it

Fail early with a helpful message if the user does not have sufficient
permission to modify an OSTree repository.

11 years agoAdd ostree_ensure_repo_writable()
Matthew Barnes [Fri, 16 Jan 2015 15:04:18 +0000 (10:04 -0500)]
Add ostree_ensure_repo_writable()

Commands that need to write files within the repo directory can call
this early to ensure the directory is writable for the current user.
If not, it fails with a helpful "You need to be root to perform this
command" message.

11 years agoAdd ostree_repo_is_writable()
Matthew Barnes [Mon, 19 Jan 2015 01:27:53 +0000 (20:27 -0500)]
Add ostree_repo_is_writable()

11 years agoRelease 2015.4
Colin Walters [Wed, 25 Mar 2015 16:50:50 +0000 (12:50 -0400)]
Release 2015.4

11 years agogpg-sign: Add missing NULL terminator in options
Colin Walters [Tue, 24 Mar 2015 13:57:27 +0000 (09:57 -0400)]
gpg-sign: Add missing NULL terminator in options

11 years agoFix build with !HAVE_LIBSOUP
Alexander Larsson [Mon, 23 Mar 2015 13:17:52 +0000 (14:17 +0100)]
Fix build with !HAVE_LIBSOUP

Fix up ostree_repo_pull to match the new declaration

11 years agogpg-sign: Update man page for --delete option
Matthew Barnes [Fri, 20 Mar 2015 16:57:20 +0000 (12:57 -0400)]
gpg-sign: Update man page for --delete option

11 years agolibglnx: Update to latest
Colin Walters [Fri, 20 Mar 2015 14:56:45 +0000 (10:56 -0400)]
libglnx: Update to latest

Just on general principle.  Newer is better.

11 years agobuild: ostree-gpg-verify-result.h is a public header, install it
Colin Walters [Fri, 20 Mar 2015 14:55:56 +0000 (10:55 -0400)]
build: ostree-gpg-verify-result.h is a public header, install it

11 years agoFix build failure on g_autoptr(gchar) with glib master
Alexander Larsson [Fri, 20 Mar 2015 14:36:56 +0000 (15:36 +0100)]
Fix build failure on g_autoptr(gchar) with glib master

This was removed in favour of g_autofree

11 years agogpg: Regenerate test data for test-gpg-verify-result
Matthew Barnes [Thu, 19 Mar 2015 16:43:04 +0000 (12:43 -0400)]
gpg: Regenerate test data for test-gpg-verify-result

Turns out the expired signature case was failing because the signature
itself was corrupted.  Reconstructed the test data and updated the test
code.  Note, an expired signature is still counted as valid.

Also, handy debugging trick for setting a key or signature expiry: the
CLI makes it appear the shortest expiry is 1 day, but it also secretly
recognizes "seconds=N".

11 years agogpg: Link to GPGME bug about GPGME_SIGSUM_KEY_REVOKED
Matthew Barnes [Thu, 19 Mar 2015 14:21:08 +0000 (10:21 -0400)]
gpg: Link to GPGME bug about GPGME_SIGSUM_KEY_REVOKED

11 years agotests: Update test-gpg-signed-commit.sh
Matthew Barnes [Tue, 17 Mar 2015 15:22:27 +0000 (11:22 -0400)]
tests: Update test-gpg-signed-commit.sh

Utilize and test new CLI capabilities:

  - Signature count in 'ostree show' result
  - Duplicate signatures now rejected
  - Ability to delete signatures

11 years agoshow: Print a blurb for each signature on a commit
Matthew Barnes [Sun, 15 Mar 2015 19:41:03 +0000 (15:41 -0400)]
show: Print a blurb for each signature on a commit

Roughly mimics the output of "gpg --verify".

11 years agogpg-sign: Add a --delete option to delete signatures
Matthew Barnes [Thu, 12 Mar 2015 23:01:44 +0000 (19:01 -0400)]
gpg-sign: Add a --delete option to delete signatures

11 years agorepo: Reject duplicate signatures when signing commit
Matthew Barnes [Thu, 12 Mar 2015 23:00:51 +0000 (19:00 -0400)]
repo: Reject duplicate signatures when signing commit

Uses OstreeGpgVerifyResult to catch duplicate signatures.

If the commit has already been signed with the given GPG key ID, fail
with a G_IO_ERROR_EXISTS error code.

11 years agorepo: Add ostree_repo_verify_commit_ext()
Matthew Barnes [Wed, 11 Mar 2015 23:21:33 +0000 (19:21 -0400)]
repo: Add ostree_repo_verify_commit_ext()

Similar to ostree_repo_verify_commit(), but returns more verification
details by way of an OstreeGpgVerifyResult object instead of a boolean.

11 years agogpg: Add OstreeGpgVerifyResult
Matthew Barnes [Wed, 4 Mar 2015 17:44:47 +0000 (12:44 -0500)]
gpg: Add OstreeGpgVerifyResult

Wrappers a referenced gpgme_verify_result_t so detailed verify results
can be examined independently of executing a verify operation.

_ostree_gpg_verifier_check_signature() now returns this object instead
of a single valid/invalid boolean, but the idea is for OstreeRepo to also
return this object for commit signature verification so it can be utilized
at the CLI layer (and possibly by other programs).

11 years agofsck: Fix object count output
Dan Nicholson [Tue, 17 Mar 2015 19:20:53 +0000 (12:20 -0700)]
fsck: Fix object count output

The object count comes from g_hash_table_size(), so it's not a 0 based
index. In order to maintain the mod calculations correctly, just print
out index + 1.

https://bugzilla.gnome.org/show_bug.cgi?id=746360

11 years agoOstreeGpgVerifier: Take the signed data as a GBytes
Matthew Barnes [Mon, 16 Mar 2015 17:01:55 +0000 (13:01 -0400)]
OstreeGpgVerifier: Take the signed data as a GBytes

Similar to c2b01ad.  For some reason I was thinking the commit data
still needed to be written to disk prior to verifying, but it's just
another artifact of spawning gpgv2 (predates using GPGME).

Makes for a nice cleanup in fetch_metadata_to_verify_delta_superblock()
as well.

11 years agoOstreeGpgVerifier: Don't add trustdb.gpg to the keyring list
Matthew Barnes [Mon, 16 Mar 2015 13:54:24 +0000 (09:54 -0400)]
OstreeGpgVerifier: Don't add trustdb.gpg to the keyring list

In case someone like me is mucking around in $OSTREE_GPG_HOME and
accidentally creates a trust database there.

11 years agoostree-repo.c: fix typo
Giuseppe Scrivano [Mon, 16 Mar 2015 10:27:19 +0000 (11:27 +0100)]
ostree-repo.c: fix typo

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agorepo: Delete .commitmeta file on empty metadata
Matthew Barnes [Fri, 13 Mar 2015 01:17:34 +0000 (21:17 -0400)]
repo: Delete .commitmeta file on empty metadata

The API docs for ostree_repo_write_commit_detached_metadata() were
written as though it already behaved that way.

https://bugzilla.gnome.org/746123

11 years agobuild: Use both pkg-config and AM_PATH_GPGME
Colin Walters [Wed, 11 Mar 2015 19:58:42 +0000 (15:58 -0400)]
build: Use both pkg-config and AM_PATH_GPGME

Apparently OpenEmbeddeded only supports pkg-config (and includes
gpgme.pc in its content), and Fedora only has the latter.  So do both.

11 years agoconfigure.ac: Make gpgme a hard dependency
Matthew Barnes [Wed, 11 Mar 2015 15:34:59 +0000 (11:34 -0400)]
configure.ac: Make gpgme a hard dependency

In anticipation of API enhancements for GPG signature verification, which
would otherwise require a non-functional stub version were GPGME excluded.

GPGME is a pretty lightweight dependency, and the motivation to exclude
it is not clear.

11 years agoREADME.md: Note make check
Colin Walters [Wed, 11 Mar 2015 01:51:20 +0000 (21:51 -0400)]
README.md: Note make check

11 years agosysroot: Port some deployment reading code to fd-relative APIs
Colin Walters [Tue, 10 Mar 2015 13:07:59 +0000 (09:07 -0400)]
sysroot: Port some deployment reading code to fd-relative APIs

More low hanging fruit in the sysroot department.

11 years agodeployment: Add an API to get relative origin path
Colin Walters [Tue, 10 Mar 2015 13:07:12 +0000 (09:07 -0400)]
deployment: Add an API to get relative origin path

This will be used for fd-relative cleanups.

11 years agosysroot: Drop unnecessary new sysroot object
Colin Walters [Tue, 10 Mar 2015 12:41:04 +0000 (08:41 -0400)]
sysroot: Drop unnecessary new sysroot object

We're asserting that "/" is the same as our path, so we don't need to
make a new object.

11 years agoostree-prepare-root: log informational messages to stdout
Daniel Drake [Mon, 9 Mar 2015 18:20:18 +0000 (12:20 -0600)]
ostree-prepare-root: log informational messages to stdout

ostree-prepare-root was logging normal, informational messages
to stderr which the systemd unit points to the console.

To achieve silent boot, log these ordinary messages to stdout only.

11 years agoglnx: Update
Colin Walters [Tue, 10 Mar 2015 01:21:47 +0000 (21:21 -0400)]
glnx: Update

11 years agosysroot: Make origin parsing code fd-relative
Colin Walters [Thu, 5 Mar 2015 23:42:22 +0000 (18:42 -0500)]
sysroot: Make origin parsing code fd-relative

Just more API conversion.

11 years agosysroot: Read the bootloader configuration with fd-relative API
Colin Walters [Thu, 5 Mar 2015 02:33:25 +0000 (21:33 -0500)]
sysroot: Read the bootloader configuration with fd-relative API

Another piece of the conversion.

11 years agosysroot: Read some bootloader state with fd-relative API
Colin Walters [Thu, 5 Mar 2015 02:03:25 +0000 (21:03 -0500)]
sysroot: Read some bootloader state with fd-relative API

This is the start of migrating the deployment path to fd-relative
code.

11 years agotests: Add tests for test-ot-tool-util
Giuseppe Scrivano [Fri, 6 Mar 2015 11:54:53 +0000 (12:54 +0100)]
tests: Add tests for test-ot-tool-util

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: Drop unused argument "value" from ot_parse_boolean
Giuseppe Scrivano [Fri, 6 Mar 2015 11:53:43 +0000 (12:53 +0100)]
src: Drop unused argument "value" from ot_parse_boolean

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: Move ot-tool-util from ostree/ to libotutil/
Giuseppe Scrivano [Fri, 6 Mar 2015 11:21:07 +0000 (12:21 +0100)]
src: Move ot-tool-util from ostree/ to libotutil/

These utilities are not actually specific to the ostree commandline.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agolibotutil: remove ot-waitable-queue.
Giuseppe Scrivano [Fri, 6 Mar 2015 10:48:24 +0000 (11:48 +0100)]
libotutil: remove ot-waitable-queue.

The module is not not used anymore.  It can be restored from git if
needed again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: add test for test-ot-opt-utils.
Giuseppe Scrivano [Fri, 6 Mar 2015 10:38:13 +0000 (11:38 +0100)]
tests: add test for test-ot-opt-utils.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agokeyfile-utils: add tests
Giuseppe Scrivano [Thu, 5 Mar 2015 14:40:52 +0000 (15:40 +0100)]
keyfile-utils: add tests

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoot_keyfile_copy_group: return FALSE on invalid inputs
Giuseppe Scrivano [Thu, 5 Mar 2015 13:40:00 +0000 (14:40 +0100)]
ot_keyfile_copy_group: return FALSE on invalid inputs

The function returns a gboolean, replace g_return_if_fail with
g_return_val_if_fail.

Add similar checks to the other functions.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoostree-repo-refs: Drop unused function "parse_rev_file".
Giuseppe Scrivano [Thu, 5 Mar 2015 11:18:30 +0000 (12:18 +0100)]
ostree-repo-refs: Drop unused function "parse_rev_file".

If it will be needed in future, it can be retrieved from the git
history.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agosrc: drop some dead assignments
Giuseppe Scrivano [Thu, 5 Mar 2015 10:57:41 +0000 (11:57 +0100)]
src: drop some dead assignments

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoOstreeGpgVerifier: Take the signature as a GBytes
Matthew Barnes [Tue, 3 Mar 2015 19:15:27 +0000 (14:15 -0500)]
OstreeGpgVerifier: Take the signature as a GBytes

The signature data is in memory to begin with, so there's no need to
write it to disk only to immediately read it back.

Also, because the GPGME multi-keyring workaround is somewhat expensive
to setup and teardown, concatenate all signatures into a single GBytes
so _ostree_gpg_verifier_check_signature() is only called once.  We're
currently only looking for one valid signature anyway.

11 years agogpg: Rewrite OstreeGpgVerifier to use GPGME
Matthew Barnes [Mon, 2 Mar 2015 16:16:16 +0000 (11:16 -0500)]
gpg: Rewrite OstreeGpgVerifier to use GPGME

This sets the stage for more advanced signature management.

(Also, talking to GPG over pipes sucks.)

Previously we were spawning gpgv2 with a bunch of --keyring options
for /usr/share/ostree/trusted.gpg.d/ and whatever other keyring files
were explicitly added.  GPGME has no public API for multiple keyrings,
so we work around the issue by setting up a temp directory to serve as
a fake "home" directory for the crypto engine and then concatenate all
the keyring files into a single public keyring (pubring.gpg).

Unfortunately at present we do this on every signature verification.
There's a desire to cache this concatenation, but the problem is the
user may be unprivileged.  So it seems the cache would have to be per
user under $XDG_CACHE_HOME, which OSTree doesn't otherwise use.  I'm
open to suggestions.

We do at least clean up the temp directory when finished, and I have
further API changes planned to OstreeGpgVerifier to help mitigate the
performance impact.

11 years agotests: add tests for mutable tree.
Giuseppe Scrivano [Wed, 4 Mar 2015 13:14:18 +0000 (14:14 +0100)]
tests: add tests for mutable tree.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agorepo: Fix assertion to allow NULL options
Colin Walters [Wed, 4 Mar 2015 02:18:40 +0000 (21:18 -0500)]
repo: Fix assertion to allow NULL options

Spotted by Adam Coldrick.

11 years agocommit: Add missing (allow-none) in write_ref_immediate()
Colin Walters [Wed, 4 Mar 2015 02:16:33 +0000 (21:16 -0500)]
commit: Add missing (allow-none) in write_ref_immediate()

Spotted by Adam Coldrick.

11 years agodeltas: Use mmap() instead of copying input file
Colin Walters [Tue, 3 Mar 2015 23:39:45 +0000 (18:39 -0500)]
deltas: Use mmap() instead of copying input file

It's more efficient.

11 years agodeltas: Gather statistics on total number rollsum'd and bsdiff'd
Colin Walters [Tue, 3 Mar 2015 22:48:37 +0000 (17:48 -0500)]
deltas: Gather statistics on total number rollsum'd and bsdiff'd

Useful for debugging at least.  Though in the future it'd be nice to
store this inside the delta metadata maybe?

11 years agotests: Remove some duplications from Makefile-tests.am
Giuseppe Scrivano [Tue, 3 Mar 2015 13:21:40 +0000 (14:21 +0100)]
tests: Remove some duplications from Makefile-tests.am

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: enforce ${CMD_PREFIX} on all ostree processes
Giuseppe Scrivano [Tue, 3 Mar 2015 12:13:54 +0000 (13:13 +0100)]
tests: enforce ${CMD_PREFIX} on all ostree processes

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoostree_repo_static_delta_generate: add new param "verbose"
Giuseppe Scrivano [Tue, 3 Mar 2015 10:59:09 +0000 (11:59 +0100)]
ostree_repo_static_delta_generate: add new param "verbose"

it will be used by the next patch that adds "--generate-static-delta"
to the commit command.

As part of the patch, update the list of supported "params" in the
documentation.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agostatic-delta: Add --disable-bsdiff option
Colin Walters [Mon, 2 Mar 2015 23:31:23 +0000 (18:31 -0500)]
static-delta: Add --disable-bsdiff option

A builder may not want to pay the CPU penalty.  Also it's useful for
evaluating performance.

11 years agoMakefile.dist-packaging: fix make rpm with submodules
Giuseppe Scrivano [Mon, 2 Mar 2015 10:39:51 +0000 (11:39 +0100)]
Makefile.dist-packaging: fix make rpm with submodules

Makefile.dist-packaging seems to assume to be run under packaging/ as
"make -C packaging -f Makefile.dist-packaging rpm" so ensure the
srcdir is set correctly to point to the parent directory.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoFix "make syntax-check" failures.
Giuseppe Scrivano [Mon, 23 Feb 2015 11:06:09 +0000 (12:06 +0100)]
Fix "make syntax-check" failures.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoautogen.sh: replace all $(libbsdiff_srcpath) and $(libglnx_srcpath)
Giuseppe Scrivano [Mon, 23 Feb 2015 10:57:02 +0000 (11:57 +0100)]
autogen.sh: replace all $(libbsdiff_srcpath) and $(libglnx_srcpath)

The variable could be specified more times on the same line, having
something like:

EXTRA_DIST += ./libglnx/README $(libglnx_srcpath)/COPYING

Now the change ensures that it looks like:

EXTRA_DIST += ./libglnx/README ./libglnx/COPYING

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: add test for bsdiff
Giuseppe Scrivano [Mon, 23 Feb 2015 09:05:19 +0000 (10:05 +0100)]
tests: add test for bsdiff

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agostatic-delta: increase threshold for rollsum to 50%
Giuseppe Scrivano [Tue, 24 Feb 2015 11:16:46 +0000 (12:16 +0100)]
static-delta: increase threshold for rollsum to 50%

It favours bsdiff usage for files that are not very rollsum friendly.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoAdd bsdiff support to deltas
Giuseppe Scrivano [Mon, 23 Feb 2015 09:35:17 +0000 (10:35 +0100)]
Add bsdiff support to deltas

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoAdd bsdiff submodule
Giuseppe Scrivano [Thu, 12 Feb 2015 15:24:50 +0000 (16:24 +0100)]
Add bsdiff submodule

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agorepo: Port hardlink-scanning code to fd-relative calls
Colin Walters [Tue, 3 Mar 2015 14:13:47 +0000 (09:13 -0500)]
repo: Port hardlink-scanning code to fd-relative calls

Continuing the migration.

11 years agorepo: Drop internal GFile* API helper
Colin Walters [Tue, 3 Mar 2015 13:19:20 +0000 (08:19 -0500)]
repo: Drop internal GFile* API helper

There are no users anymore.

11 years agodeploy: Use glnx file copy code
Colin Walters [Thu, 26 Feb 2015 13:50:59 +0000 (08:50 -0500)]
deploy: Use glnx file copy code

This is centralizing more generic utility code in libglnx.

11 years agocore: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()
Matthew Barnes [Mon, 2 Mar 2015 19:43:41 +0000 (14:43 -0500)]
core: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()

g_variant_builder_add() does not replace identical keys in a VARDICT
variant, so signing a commit multiple times results in multiple copies
of "ostree.gpgsigs" in the metadata.  And since g_variant_lookup_value()
stops on the first match, subsequent signatures have no net effect.

Instead of GVariantBuilder use GVariantDict, which behaves more like a
hash table.

11 years agocore: Add definitions for GPG signature metadata
Matthew Barnes [Mon, 2 Mar 2015 19:30:52 +0000 (14:30 -0500)]
core: Add definitions for GPG signature metadata

_OSTREE_METADATA_GPGSIGS_NAME
_OSTREE_METADATA_GPGSIGS_TYPE

11 years agolibotutil: Allow no variant in ot_util_variant_builder_from_variant()
Matthew Barnes [Mon, 2 Mar 2015 19:55:01 +0000 (14:55 -0500)]
libotutil: Allow no variant in ot_util_variant_builder_from_variant()

For programming convenience in cases where we may or may not have a
GVariant to initialize the builder with.

11 years agolibotutil: Remove ot_variant_new_from_bytes()
Matthew Barnes [Mon, 2 Mar 2015 20:11:16 +0000 (15:11 -0500)]
libotutil: Remove ot_variant_new_from_bytes()

Not needed anymore - use g_variant_new_from_bytes().

11 years agoconfigure.ac: Bump GLib requirement to 2.40
Matthew Barnes [Mon, 2 Mar 2015 19:05:16 +0000 (14:05 -0500)]
configure.ac: Bump GLib requirement to 2.40

Mainly for GVariantDict, useful for metadata.

11 years agogpg: Remove _ostree_gpg_verifier_set_homedir()
Matthew Barnes [Fri, 27 Feb 2015 18:34:17 +0000 (13:34 -0500)]
gpg: Remove _ostree_gpg_verifier_set_homedir()

Never called, and the setting is never applied anyway.

11 years agoostree: Add gpg-sign command
Matthew Barnes [Wed, 25 Feb 2015 18:55:14 +0000 (13:55 -0500)]
ostree: Add gpg-sign command

Signs a commit with one or more GPG keys.

11 years agorepo: detached sigs: Use error prefixing instead of overwriting
Colin Walters [Tue, 24 Feb 2015 18:39:22 +0000 (13:39 -0500)]
repo: detached sigs: Use error prefixing instead of overwriting

Noted when "rpm-ostree compose sign" failed to write to a repo due to
permissions.

11 years agoprepare-root: Move /sysroot instead of unmounting it
Colin Walters [Fri, 13 Feb 2015 02:01:23 +0000 (21:01 -0500)]
prepare-root: Move /sysroot instead of unmounting it

I originally thought this would fix a regression, but it turns out
this wasn't the bug.  But pushing anyways as it's just cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=743891

11 years agobuild: build libbupsplit separately
Giuseppe Scrivano [Mon, 23 Feb 2015 11:44:47 +0000 (12:44 +0100)]
build: build libbupsplit separately

It avoids gobject-introspection warnings:

src/libostree/bupsplit.h:42: Warning: OSTree: symbol='bupsplit_find_ofs': Unknown namespace for symbol 'bupsplit_find_ofs'
src/libostree/bupsplit.h:43: Warning: OSTree: symbol='bupsplit_selftest': Unknown namespace for symbol 'bupsplit_selftest'
src/libostree/bupsplit.h:33: Warning: OSTree: symbol='BUP_BLOBBITS': Unknown namespace for symbol 'BUP_BLOBBITS'
src/libostree/bupsplit.h:34: Warning: OSTree: symbol='BUP_BLOBSIZE': Unknown namespace for symbol 'BUP_BLOBSIZE'
src/libostree/bupsplit.h:35: Warning: OSTree: symbol='BUP_WINDOWBITS': Unknown namespace for symbol 'BUP_WINDOWBITS'
src/libostree/bupsplit.h:36: Warning: OSTree: symbol='BUP_WINDOWSIZE': Unknown namespace for symbol 'BUP_WINDOWSIZE'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoostree-repo-static-delta-processing: initialize "modev"
Giuseppe Scrivano [Mon, 23 Feb 2015 10:51:48 +0000 (11:51 +0100)]
ostree-repo-static-delta-processing: initialize "modev"

Can be gs_unref_variant'ed on an early error.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoFix GObject introspection annotation
Giuseppe Scrivano [Mon, 23 Feb 2015 10:18:05 +0000 (11:18 +0100)]
Fix GObject introspection annotation

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoostree-repo-traverse.c: Fix documentation parameter name
Giuseppe Scrivano [Mon, 23 Feb 2015 11:47:47 +0000 (12:47 +0100)]
ostree-repo-traverse.c: Fix documentation parameter name

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: Move test gpg keyring into writable tmpdir
Colin Walters [Mon, 23 Feb 2015 18:02:37 +0000 (13:02 -0500)]
tests: Move test gpg keyring into writable tmpdir

At least the version of gpgme in RHEL7 wants to create a lock file,
work around this by copying it into the writable test temporary
directory.

11 years agoAdd explicit zlib dependency
Matthew Barnes [Mon, 23 Feb 2015 19:47:56 +0000 (14:47 -0500)]
Add explicit zlib dependency

Needed for CRC32 computations.

11 years agorepo: Port APIs used by prune to fd-relative *at calls
Colin Walters [Fri, 20 Feb 2015 21:09:22 +0000 (16:09 -0500)]
repo: Port APIs used by prune to fd-relative *at calls

More of the general trend away from GFile * to the faster and more
secure world of *at().

11 years agolibglnx: Use git.gnome.org's copy
Colin Walters [Mon, 23 Feb 2015 03:30:53 +0000 (22:30 -0500)]
libglnx: Use git.gnome.org's copy

Not the master from my laptop.

11 years agocheckout: Drop internal use of GFile *
Colin Walters [Fri, 20 Feb 2015 21:36:02 +0000 (16:36 -0500)]
checkout: Drop internal use of GFile *

Checkout was one of the first complex code paths I tried to convert to
*at().  I ended up keeping both, because I hit the "xattrs for a
symlink" problem.  Later, Florian gave me a workaround, and we started
using it here, but the GFile * parameters weren't deleted.  They're
not used, so do so now.

11 years agodeploy: Also look for /usr/lib/os-release
Colin Walters [Fri, 13 Feb 2015 02:35:19 +0000 (21:35 -0500)]
deploy: Also look for /usr/lib/os-release

With newer versions of systemd, the file has moved there.

11 years agoUse libglnx
Colin Walters [Tue, 17 Feb 2015 22:38:36 +0000 (17:38 -0500)]
Use libglnx

Starting down the path of not using libgsystem.  The main win here
will be code sharing between ostree/rpm-ostree as well as going down
the path of not using GFile * for local files.

11 years agotests: do not run tests/test-rollsum as part of make check
Giuseppe Scrivano [Fri, 13 Feb 2015 10:50:37 +0000 (11:50 +0100)]
tests: do not run tests/test-rollsum as part of make check

it is not really a unit test.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Conflicts:
Makefile-tests.am

11 years agorepo: Check for OSTREE_REPO in ostree_repo_new_default()
Matthew Barnes [Thu, 19 Feb 2015 15:30:25 +0000 (10:30 -0500)]
repo: Check for OSTREE_REPO in ostree_repo_new_default()

Convenience feature to avoid having to pass --repo options repeatedly.

Before falling back to the default system repository path, check for a
repository path defined by the OSTREE_REPO environment variable.

11 years agolibostree: set directory mtimes to 0 on checkout
Daniel Drake [Wed, 18 Feb 2015 23:18:21 +0000 (17:18 -0600)]
libostree: set directory mtimes to 0 on checkout

We already set all file mtimes to 0 so that they are constant
over all checkouts, and can be made constant with a known value from
the system where the ostree was created.

However, this was not happening for directories. Zero their mtimes too.

This is important for shipping a fontconfig cache in the ostree;
the fontconfig cache files embed a directory mtime.

11 years agotests: Restore accidentally deleted Makefile bit
Colin Walters [Mon, 16 Feb 2015 15:29:14 +0000 (10:29 -0500)]
tests: Restore accidentally deleted Makefile bit

Not sure how this got deleted...

11 years agodeltas: Search for similar objects (possibly renamed across directories)
Colin Walters [Wed, 11 Feb 2015 08:29:14 +0000 (03:29 -0500)]
deltas: Search for similar objects (possibly renamed across directories)

The previous diff algorithm was file tree based, and only looked
at modified files that lived at the same path.

However, components like the Linux kernel have versioned
subdirectories, e.g. /usr/lib/modules/$kver/.../ext4.ko.  We want to
be able to detect these "modified renames" so that we can compute
diffs (rollsum, bsdiff).

11 years agorepo: Add a new iterator traversal API for commits
Colin Walters [Wed, 11 Feb 2015 08:25:17 +0000 (03:25 -0500)]
repo: Add a new iterator traversal API for commits

This is a more optimized version of the GFile * APIs, and is now used
internally by the previous ostree_repo_traverse().

11 years agodeltas: Prune deltas when the corresponding "to" commit vanishes
Colin Walters [Mon, 2 Feb 2015 18:04:52 +0000 (13:04 -0500)]
deltas: Prune deltas when the corresponding "to" commit vanishes

We want prune to actually give you back disk space when using deltas.

11 years agodeltas: Make syntax-check happy
Colin Walters [Sat, 31 Jan 2015 19:52:16 +0000 (14:52 -0500)]
deltas: Make syntax-check happy

11 years agodeltas: Implement rollsums
Colin Walters [Fri, 30 Jan 2015 15:13:07 +0000 (10:13 -0500)]
deltas: Implement rollsums

This does an rsync-style prepared delta basically.  On my test data,
it shaves ~6MB of uncompressed data.  Not a huge amount, but I expect
this to be more useful for things like binaries which embed data, etc.

11 years agodeltas: Initial code to copy content from existing objects
Colin Walters [Fri, 30 Jan 2015 04:00:51 +0000 (23:00 -0500)]
deltas: Initial code to copy content from existing objects

This is preparatory work for implementing rollsum support.

11 years agodeltas: Flesh out the open/write/close opcodes
Colin Walters [Fri, 30 Jan 2015 03:32:44 +0000 (22:32 -0500)]
deltas: Flesh out the open/write/close opcodes

Refactor open-splice-and-close to call open/close.  We can't just call
write as that would require duplicating the object size parameter.

11 years agodeltas: Use the new internal streaming APIs
Colin Walters [Fri, 6 Feb 2015 02:35:01 +0000 (21:35 -0500)]
deltas: Use the new internal streaming APIs

This is significantly more efficient.

11 years agodeltas: Stub out a few more opcodes
Colin Walters [Thu, 29 Jan 2015 22:54:59 +0000 (17:54 -0500)]
deltas: Stub out a few more opcodes